home *** CD-ROM | disk | FTP | other *** search
- /*
- File: OTSimpleDownloadHTTP.h
-
- Contains: Interface to the simple HTTP download sample.
-
- Written by: Quinn "The Eskimo!"
-
- Copyright: Copyright © 1997-1999 by Apple Computer, Inc., All Rights Reserved.
-
- You may incorporate this Apple sample source code into your program(s) without
- restriction. This Apple sample source code has been provided "AS IS" and the
- responsibility for its operation is yours. You are not permitted to redistribute
- this Apple sample source code as "Apple sample source code" after having made
- changes. If you're going to re-distribute the source, we require that you make
- it clear in the source that the code was descended from Apple sample source
- code, but that you've made changes.
-
- Change History (most recent first):
- 7/23/1999 Karl Groethe Updated for Metrowerks Codewarror Pro 2.1
-
-
- */
- #include <Types.h>
-
- OSStatus DownloadHTTPSimple(const char *hostName,
- const char *httpCommand,
- const short destFileRefNum);
-
- // Download a URL from the a web server. hostName is a pointer
- // to a string that contains the DNS address of the web server.
- // The DNS address must be suffixed by ":<port>", where <port>
- // is the port number the web server is operating on.
- // httpCommand contains the HTTP command to send. Typically this
- // is of the form:
- //
- // GET <x> HTTP/1.0\0x13\0x10\0x13\0x10
- //
- // where <x> is the URL path. destFileRefNum is the file
- // reference number to which the results of the HTTP command
- // are written. This routine does not parse the returned HTTP
- // header in any way. The entire incoming stream goes into
- // the file verbatim.
- //
- // For example, if you were asked to download a URL like:
- //
- // http://devworld.apple.com/dev/technotes.shtml
- //
- // you would set:
- //
- // o hostName to "devworld.apple.com:80" (80 is the
- // default port for HTTP.
- // o httpCommand to "GET /dev/technotes.shtml HTTP/1.0\0x13\0x10\0x13\0x10"
-